package cn.edu.neusoft.zengweidong707.neufood.service;

import java.util.List;

import cn.edu.neusoft.zengweidong707.neufood.bean.FoodByIdBean;
import cn.edu.neusoft.zengweidong707.neufood.bean.FoodListBean;
import cn.edu.neusoft.zengweidong707.neufood.bean.IsCollectedBean;
import cn.edu.neusoft.zengweidong707.neufood.bean.IsSuccessBean;
import cn.edu.neusoft.zengweidong707.neufood.bean.LoginBean;
import cn.edu.neusoft.zengweidong707.neufood.bean.ShopListBean;
import cn.edu.neusoft.zengweidong707.neufood.bean.UserByIdBean;
import cn.edu.neusoft.zengweidong707.neufood.bean.UserCollectionListBean;
import cn.edu.neusoft.zengweidong707.neufood.bean.UserOrderBean;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;

/**
 * Created by Lucio on 2017/11/2.
 */

public interface ResService {
    //获取登录接口
    @GET("userLogin.do")
    Call<LoginBean> login(@Query("username") String username,
                          @Query("userpass") String userpass);
    //获取注册接口
    @GET("userRegister.do")
    Call<IsSuccessBean> reg(@Query("username") String username,
                            @Query("userpass") String userpass,
                            @Query("mobilenum") String mobilenum,
                            @Query("address") String address,
                            @Query("comment") String comment);

    //获取店铺列表接口
    @GET("getAllShops.do")
    Call<List<ShopListBean>> getShop();

    //获取店铺详情接口
    @GET("getFoodByShop.do")
    Call<List<FoodListBean>> getFood(@Query("shop_id") int shop_id);

    //获取菜品详情接口
    @GET("getFoodById.do")
    Call<FoodByIdBean> getFoodById(
            @Query("food_id") int food_id
    );

    //购买接口
    @GET("insertOrder.do")
    Call<IsSuccessBean> buyFood(
            @Query("user_id") int user_id,
            @Query("food_id") int food_id,
            @Query("num") int num,
            @Query("sum") double sum,
            @Query("suggesttime") String suggesttime
    );

    //收藏/取消收藏店铺接口
    @GET("userCollectShop.do")
    Call<IsSuccessBean> getShopCollection(
            @Query("user_id") int user_id,
            @Query("shop_id") int shop_id
    );

    //收藏/取消菜品接口
    @GET("userCollectFood.do")
    Call<IsSuccessBean> getFoodCollection(
            @Query("user_id") int user_id,
            @Query("food_id") int food_id
    );

    //判断是否收藏接口
    @GET("isCollected.do")
    Call<IsCollectedBean> getCollected(
            @Query("user_id") int user_id,
            @Query("shop_food_id") int shop_food_id,
            @Query("flag") int flag
    );

    //获取用户收藏列表接口
    @GET("getAllUserCollection.do")
    Call<List<UserCollectionListBean>> getUserCollectionList(
            @Query("user_id") int user_id,
            @Query("flag") int flag
    );

    //搜索菜谱接口
    @GET("getFoodBySearch.do")
    Call<List<FoodListBean>> getSearchList(
            @Query("search") String search
    );

    //获取用户信息
    @GET("getUserById.do")
    Call<UserByIdBean> getUserById(
            @Query("user_id") int user_id
    );

    //修改用户信息接口
    @GET("updateUserById.do")
    Call<IsSuccessBean> getUserInfo(
            @Query("user_id") int user_id,
            @Query("username") String username,
            @Query("userpass") String userpass,
            @Query("mobilenum") String mobilenum,
            @Query("address") String address
    );

    //获取当前用户所有订单信息
    @GET("getAllUserOrder.do")
    Call<List<UserOrderBean>> getUserOrder(
            @Query("user_id") int user_id
    );

    //获取菜谱评价接口
    @GET("getAllUserFoodOrder.do")
    Call<List<UserOrderBean>> getFoodOrder(
            @Query("food_id") int food_id
    );

    //添加评论信息
    @GET("insertComment.do")
    Call<IsSuccessBean> insertComment(
            @Query("order_id") int order_id,
            @Query("content") String content
    );

    //获取当前用户评论信息接口
    @GET("getAllUserComment.do")
    Call<List<UserOrderBean>> getUserComment(
            @Query("user_id") int user_id
    );

}
